package gdma.hqdes.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import gdma.hqdes.bean.UnitScoreAtt;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UnitScoreAttMapper extends BaseMapper<UnitScoreAtt> {

    @Select("select a.* from unit_score s, unit_score_att a where s.id=a.score_id and s.project_id=#{projectId} and s.unit_id=#{unitId} order by a.seq, a.id")
    List<UnitScoreAtt> selectUnitScoreAtts(long projectId, long unitId);

    @Delete("delete from unit_score_att where score_id=#{scoreId}")
    int deleteByScoreId(long scoreId);

}
